<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Send POST Request</title>
</head>

<body>
    <button id="sendRequestButton">Send Request</button>
    <div id="responseDisplay"></div>

    <script>
        const url = 'https://218.94.1.82:32199/JmYfjzService/managerChildCardService';
        const xmlPayload = `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rem="http://remote.ss.jm.chis.com/">
  <soapenv:Header/>
  <soapenv:Body>
    <rem:findChildReg>
      <unitCode>3205810701</unitCode>
      <loginPwd>32058107012025011414</loginPwd>
      <arg2>1009814461887</arg2>
    </rem:findChildReg>
  </soapenv:Body>
</soapenv:Envelope>
`;

        const options = {
            method: 'POST',
            headers: {
                'Content-Type': 'text/xml; charset=UTF-8',
                'Content-Length': xmlPayload.length,
                'Host': '218.94.1.82:32199',
                'Accept': '*/*',
                'Accept-Encoding': 'identity',
                'Accept-Language': 'zh-cn',
                'User-Agent': 'Apache-HttpClient/4.1.1 (java 1.5)'
            },
            body: xmlPayload
        };

        const sendRequestButton = document.getElementById('sendRequestButton');
        const responseDisplay = document.getElementById('responseDisplay');

        sendRequestButton.addEventListener('click', async () => {
            try {
                const response = await fetch(url, options);
                if (!response.ok) {
                    throw new Error(`HTTP error! status: ${response.status}`);
                }
                const data = await response.text();
                responseDisplay.textContent = `Response: ${data}`;
            } catch (error) {
                responseDisplay.textContent = `Error: ${error.message}`;
            }
        });
    </script>
</body>

</html>    